package com.tapstitch.scm.common.enums;

import org.springframework.util.StringUtils;

public enum TmsExpressEnum {

    WINLINK("winlink", "合联",true),
   // IMILE_NEW("imile_new", "imile_new", true, null),
    ZAJIL("zajil", "zajil",true),
    SFC("sfc", "三态速递",false),
    YI_TAI("yitai","亿泰",true),

    XING_YUN_YI("xingyunyi","行运易",false),
    GZCD("gzcd","广州成达", false),
    SZTY("szty","深圳天运", false),
    JI_SU("jisu","急速国际", false),

    DHL("dhl", "DHL",false),
    GFS("gfs", "GFS",false),
    DI_SI_FANG("disifang", "递四方",false),

    CHU_KOU_YI("chukouyi", "出口易",false),

    JI_TU_GUO_JI("jitu", "极兔国际",false),

    // 20230911
    JI_TU_GUO_JI_V2("jitu_v2", "极兔国际(V2)",false),

    GZ_WEI_JIE("gzwj", "广州威捷",false), // 原香港DHL

    ARAMEX("aramex", "安迈世(ARAMEX)",false),

    FA_GE_HUO("fagehuo", "发个货",false),

    LAN_MA_TE("lanmate", "蓝玛特",false),

    YUAN_SI("yuansi", "远思",false),

    CAI_NIAO("cainiao", "菜鸟",false),

    HENG_YUAN_JIA_YUN("hyjy", "恒元嘉运",false),

    WU_LIAN("wulian", "物联",false),

    YUN_TU("yuntu", "云途",false),
    SZXY("szxy", "深圳贤邮",false),

    EASY_POST("easy_post", "EasyPost",false),

    FEDEX("fedex", "Fedex",false),

    GHOST("ghost","白泽", false),

    ITDIDA("itdida","一代国际", false),

    MING_TENG("mingteng","铭腾快递", false),

    ;


    TmsExpressEnum(String code, String name, boolean addressValidateRequired) {
        this.code = code;
        this.name = name;
        this.addressValidateRequired = addressValidateRequired;
    }

    private String code;
    private String name;
    private boolean addressValidateRequired;

    public static TmsExpressEnum getByCode(String code) {
        if (StringUtils.isEmpty(code)) {
            return null;
        }
        for (TmsExpressEnum e : TmsExpressEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }

    public static TmsExpressEnum getByName(String name) {
        if (StringUtils.isEmpty(name)) {
            return null;
        }
        for (TmsExpressEnum e : TmsExpressEnum.values()) {
            if (e.getName().equals(name)) {
                return e;
            }
        }
        return null;
    }


    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static void main(String[] args) {
        for (TmsExpressEnum e : TmsExpressEnum.values()) {
            System.out.println(e.getName());
        }
    }
}
